﻿using System;
using AutoMapper;
using Enferno.Public.Web.Models;
using Enferno.StormApiClient.Customers;

namespace Enferno.Public.Web.Mappers.CheckoutProfiles
{
    public class AddressToAddressModelProfile : AddressToAddressBaseModelProfile<AddressModel>
    {
        
    }

    public class AddressToAddressBaseModelProfile<TAddressModel> : Profile
        where TAddressModel: AddressModel
    {
        protected override void Configure()
        {
            Mapper.CreateMap<Address, TAddressModel>();

            Mapper.CreateMap<TAddressModel, Address>()
                .ForMember(to => to.ExtensionData, opts => opts.Ignore());
        }
    }
}
